

'control that maps to a key

Type TControl

	Field name:String
	Field key:Int

	field previousDown:Int
	field down:Int
	field hit:Int


	Function Create:TControl(name:String, key:Int)
		Local c:TControl = new TControl
		c.name = name
		c.key = key
		return c
	EndFunction


	Method GetName:String ()
		return name
	EndMethod

	Method GetDown:Int ()
		return down
	EndMethod

	Method GetHit:Int ()
		return hit
	EndMethod


	'uses the global function, defined in functions.bmx
	Method ToString:String ()
		return name + ": " + GetKeyCodeString(key)
	EndMethod



	Method Update()
		previousDown = down
		down = KeyDown(key)
		hit = KeyHit(key)
	EndMethod

EndType